<?php

class Footermenu_Model_Category extends Core_Model_Item_Abstract {
	public function getLink($id) {
		// prepare references
		$table_link = Engine_Api::_ ()->getDbtable ( 'references', 'footermenu' );
		$referencesTableName = $table_link->info ( 'name' );
		$select_link = $table_link->select ()->where ( "{$referencesTableName}.cat_id  = ?", $id )->order ( 'reference_id asc' );
		return $table_link->fetchAll ( $select_link );
	}
	
	public function removeAllLinks($id) {
		Engine_Api::_ ()->getDbtable ( 'references', 'footermenu' )->delete ( array ('cat_id = ?' => $id ) );
		
		return $this;
	}
}
